package com.snopy.ribbon.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;

import java.util.HashMap;
import java.util.Map;

/**
 * @author snopy
 * @version 1.0.0
 * @classname HelloController
 * @description
 * @email 77912204@qq.com
 * @date 2022/03/10 17:22
 */
@RestController
public class HelloController {
    @Autowired
    private RestTemplate restTemplate;
    @GetMapping("/sayHi")
    public String sayHi(){
        Map<String,String> param = new HashMap<>();
        //restTemplate.postForObject("http://snopy-user-service/queryUserForLogin",param,Users.class)
        return restTemplate.getForObject("http://snopy-user-service/queryUserForLogin",String.class);
    }
}
